package Test;

/**
 * @ClassName Main6
 * @Description
 * @Company inspur
 * @Author Kevin
 * @Date 2020/8/2 20:13
 * @Version 1.0
 */

import java.util.*;


public class Main6 {
    static int Mod = 1000000009;
    static int N;
    static char[][] a = new char[10][10];
    static long ans;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        for(int i = 1; i <= 6; i++) {
            a[i] = sc.nextLine().toCharArray();
        }

        ans = 0;
        dfs(1,0);
        System.out.printf("%d", ans % Mod);
    }

    public static void dfs(int x, int y) {
        if(y > 5) {
            if(x == 6) {
                ans++;
                return;
            }
            dfs(x+1, 0);
            return;
        }

        if(a[x][y] == '*') {
            dfs(x, y+1);
        } else {
            for(int i = 1; i <= 6; i++) {
                if(x != 1 && a[x-1][y] == i-1 + 'a') continue;
                if(y != 0 && a[x][y-1] == i-1 + 'a') continue;
                a[x][y] = (char)(i -1 + 'a');
                dfs(x, y+1);
            }
        }
    }

}